export default  (req,res,next)=>{
    if(!req.session?.user){
        req.session.attended = req.url
        res.redirect("/login")
    }
    else{
        next()
    }
}